import App from './App'
import * as system from '@/common/system.js'
import mainContent from '@/components/main-content'
import footBox from '@/components/foot-box/index.vue'
import tabBox from '@/components/tab-box/index.vue'
import navBox from '@/components/nav-box/index.vue'
import groupTitle from '@/components/group-title/index.vue'
import mySelect from '@/components/my-select/index.vue'

import z_paging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
import empty_view from '@/uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view.vue'

// #ifdef VUE3
// 引入 uView UI
import uView from './uni_modules/vk-uview-ui'
import {
	createSSRApp
} from 'vue'
import * as Pinia from 'pinia'
import {
	createUnistorage
} from "./uni_modules/pinia-plugin-unistorage";
export function createApp() {
	const app = createSSRApp(App)
	const pinia = Pinia.createPinia()
	pinia.use(createUnistorage());
	app.use(pinia)
	// 使用 uView UI
	app.use(uView)
	app.config.globalProperties.$System = system

	// 注册组件
	app.component('main-content', mainContent)
	app.component('foot-box', footBox)
	app.component('tab-box', tabBox)
	app.component('nav-box', navBox)
	app.component('group-title', groupTitle)
	app.component('my-select', mySelect)

	app.component('z-paging', z_paging)
	app.component('empty-view', empty_view)

	return {
		app,
		Pinia
	}
}
// #endif